<template>
  <AddBankCardForm @back="goBack" @submit="onSubmit" />
</template>

<script setup>
import AddBankCardForm from '../components/AddBankCardForm.vue'
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import { useBankCardStore } from '../stores/bankCardStore'
const router = useRouter()
const bankCardStore = useBankCardStore()
function goBack() {
  router.back()
}
function onSubmit(card) {
  bankCardStore.addCard(card)
  ElMessage.success('添加成功')
  router.push('/bank-manage')
}
</script>

<style scoped>
:deep(.add-bankcard-bg) {
  min-height: 100vh;
}
</style> 